package com.study.netty.runner;

import com.study.netty.server.BootNettyUdpServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@Order(3)
public class NettyTwoUdpServerCommandLineRunner implements CommandLineRunner {

    @Value("${gps.netty.udp.port}")
    private int port;

    @Override
    public void run(String... args) throws Exception {
        log.info("hello,启动udp server,port:{}", port);
        new BootNettyUdpServer().bind(port);
    }
}
